package com.changgou.user.feign;

import com.changgou.user.pojo.User;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName UserFeign
 * @Description
 * @Author Mr.L
 * @Date 21:46 2019/11/23
 * @Version 2.1
 **/
@FeignClient(name = "user")
@RequestMapping("/user")
public interface UserFeign {

    /**
     * 记载用户信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<User> findById(@PathVariable(value = "id") String id);

    /**
     * 给用户添加积分
     * @param username
     * @param points
     * @return
     */
    @GetMapping("/userinfo/{username}/{points}")
    Result points(@PathVariable(value = "username") String username,
                  @PathVariable(value = "points") Integer points);
}
